/*
 * @(#)HavingClear.java    0.4 21/08/2009
 */
package com.ly.mpayment.persist.catstorage;

import java.util.regex.Pattern;

/**
 * Having清理器
 * <p>该清理器用于清理语句中作废的Having关键字</p>
 * 
 * @version 0.4
 * @since 0.4
 */
public class HavingClear implements Clear {

    /**
     * 清理作废having关键字的正则表达式
     */
    private Pattern havingRegex = Pattern.compile("having\\s+(order|$)", Pattern.CASE_INSENSITIVE);

    public String clear(String statement) {
        return havingRegex.matcher(statement).replaceAll(" $1");
    }
}
